<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Powered by 9416.cn</title>


<!--#include file="../inc/conn.asp"-->

<script type="text/javascript" src="../ui/jquery.js"></script>
 <link rel="stylesheet" href="../ui/layui/css/layui.css" type="text/css"  />
 <style type="text/css">
 .skin li {
	height: 100px;
	width: 100px;
	float: left;
	text-align: center;
	margin: 10px;
	cursor: pointer;
}
 .default {
	color: #333;
	background-color: #f5f5f5;
}
 .black {
	color: #fff;
	background-color: #252839;
}
 .green {
	color: #fff;
	background-color: #297E6B;
}
 .brown {
	color: #fff;
	background-color: #816D54;
}
 .red {
	color: #fff;
	background-color: #EC5245;
}
 .blue {
	color: #fff;
	background-color: #1666cd;
}
.qing {
	color: #fff;
	background-color: #8796A8;
}
.diy {
	color: #fff;
	background-image: linear-gradient(to right, #eea2a2 0%, #bbc1bf 19%, #57c6e1 42%, #b49fda 79%, #7ac5d8 100%);

}
 .skin_info i {
	font-size: 24px;
	
}
 .skin_info h1 {
	font-size: 16px;
}
 .skin_info {
 display:none;
	margin-top: 20px;
}
 .skin li:hover .skin_info,.skin .focus .skin_info {
	 display:block;

}
 </style>
<script type="text/javascript" src="../ui/layui/layui.js"></script>



</head>


<body>
<%if jianbook.verification()=false then response.Redirect "version.asp" end if%>
 <div class="mec_div" style="padding-top:0px; padding-bottom:20px;padding-left:20px;padding-right:20px;">
     <div class="layui-tab layui-tab-brief">
<ul class="layui-tab-title site-demo-title">
   <li ><a href="info.asp">基本资料</a></li>
     <li ><a href="set.asp">设置</a></li>
    <li ><a href="email.asp">邮箱</a></li>
    <li ><a href="type_list.asp">分类</a></li>
    <li class="layui-this"><a href="skin.asp">皮肤</a></li>
   <li ><a href="version.asp">授权</a></li>
   
  </ul>
  </div>
 <%jianbook.qxmsg()
sql="select * from [info]"
  rs.open sql,conn,3,3%>
        <form id="form1" name="form1" class="layui-form"  method="post" action="?act=add&id=<%=request("id")%>">
  	  
        <ul class="skin">
          <li class="default <%if rs("skin")="default" then%>focus<%end if%>" data-value="default" >
            <div class="skin_info">
              <i class="layui-icon layui-icon-ok"></i>
              <h1>默认样式</h1>
              </div>
            </li>
          
          <li class="green <%if rs("skin")="green" then%>focus<%end if%>" data-value="green">
            <div class="skin_info">
              <i class="layui-icon layui-icon-ok"></i>
              <h1>绿色样式</h1>
              </div>
             </li>
          <li class="qing <%if rs("skin")="qing" then%>focus<%end if%>" data-value="qing">
            <div class="skin_info">
              <i class="layui-icon layui-icon-ok"></i>
              <h1>青色样式</h1>
              </div></li>  
          <li class="blue <%if rs("skin")="blue" then%>focus<%end if%>" data-value="blue">
            <div class="skin_info">
              <i class="layui-icon layui-icon-ok"></i>
              <h1>蓝色样式</h1>
              </div></li>
          <li class="red <%if rs("skin")="red" then%>focus<%end if%>" data-value="red">
            <div class="skin_info">
              <i class="layui-icon layui-icon-ok"></i>
              <h1>橘红色样式</h1>
              </div></li>
          <li class="brown <%if rs("skin")="brown" then%>focus<%end if%>" data-value="brown">
            <div class="skin_info">
              <i class="layui-icon layui-icon-ok"></i>
              <h1>棕色样式</h1>
              </div></li>
          <li class="black <%if rs("skin")="black" then%>focus<%end if%>" data-value="black">
            <div class="skin_info">
              <i class="layui-icon layui-icon-ok"></i>
              <h1>黑色样式</h1>
              </div></li>
          <li class="diy <%if rs("skin")="diy" then%>focus<%end if%>" data-value="diy">
            <div class="skin_info">
              <i class="layui-icon layui-icon-ok"></i>
              <h1>自定义</h1>
              </div>
          
          </li>
        </ul>   <input type="hidden" name="skin"  value="<%=rs("skin")%>"/> 
        <div class="layui-clear"></div> 
     <div class="layui-tab skin_diy" <%if rs("skin")<>"diy" then%>style="display:none"<%end if%>>
  <ul class="layui-tab-title">
     <li  class="layui-this">背景图片</li>
    <li>渐变背景css</li>
 
   
  </ul>
  <div class="layui-tab-content">
    
    <div class="layui-tab-item layui-show">
    
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
 <tr>
      
      <td> <div class="layui-upload">

  <input name="bgimg" type="text" class="layui-input fileurl" value="<%=rs("bgimg")%>" style="width:300px; float:left"  />
  
  <input type="button" name="button"  value="上传文件" class="layui-btn uploads"   />
  </div></td>
      
    </tr>
     <tr>
         <td height="30">Ps：输入渐变背景css或者上传背景图片，如果上传图片则只显示背景图片。</td>
    </tr>
</table>
    
    </div>
    <div class="layui-tab-item ">
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
 <tr>
      
      <td> <input name="bgcss" type="text" class="layui-input"  value="<%=rs("bgcss")%>" placeholder="background-image: linear-gradient(to top, #a18cd1 0%, #fbc2eb 100%);"></td>
         </tr>
         <tr>
         <td height="30">Ps：<a href="https://www.9416.cn/html/jianbianbeijing/" target="_blank">点击打开网址</a>，复制css样式代码</td>
    </tr>
</table>
    
    </div>
   
  </div>
</div>
   

    
       
 <input type="submit" class="layui-btn" value="保存样式" lay-submit="lay-submit" />
  </form>
    
 
 
	
</div> 
 

<%

  if request("act")="add" then

rs("skin")=request("skin")
if request.cookies("admin")("user")="admin" then
rs("bgcss")=request("bgcss")
rs("bgimg")=request("bgimg")
end if		
        rs.update
		rs.close
	
response.Write"<script>parent.location.reload();</script>"
end if
	

 
 
%>

<script>
//注意：选项卡 依赖 element 模块，否则无法进行功能性操作
layui.use(['layer','form','laydate','upload','element'], function(){ 
  var  layer = layui.layer; 
   var form = layui.form;
 var element = layui.element;
var upload = layui.upload	 
  
upload.render({
    elem: '.uploads'
    ,url: '../upload/index.asp'
    ,before: function(obj){
	layer.load(); 
    }
    ,done: function(res){
		  layer.closeAll('loading');
      //如果上传失败
      if(res.code > 0){
        return layer.msg(res.msg);
      }
      //上传成功
	    if(res.code == 0){
		
	var item=this.item
		console.log(item)
	item.parent(".layui-upload").find(".fileurl").val(res.data["src"]);
	
        return layer.msg(res.msg);
		
      }
    }
    ,error: function(){
		  layer.closeAll('loading');
      //演示失败状态，并实现重传
     return layer.msg('上传失败');
    
    }
  });

});

	$(function(){ 

  
  
	
 
 $(".skin").on("click","li",function(){
	 
		var that=this;
		var value=$(that).attr("data-value");
		$(".skin li").each(function(){
		$(this).removeClass("focus");	
		});
		$(that).addClass("focus");
		$("input[name=skin]").val(value);
		if (value=='diy')
		{$(".skin_diy").show()}
		else
		{$(".skin_diy").hide()}
		
	 })	
		 
	  

 })	
	</script>	

</body>

</html>
